public final class bd {

	private int a[] = { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476,
			0xc3d2e1f0 };
	private long b;
	private byte c[];
	private int d[];
	private int e;

	public bd() {
		b = 0L;
		c = new byte[20];
		d = new int[16];
		e = 0;
	}

	private static final int a(int i, int j) {
		return i << j | i >>> 32 - j;
	}

	private final int a(int i) {
		int ai[] = d;
		return (ai)[i] = a(ai[i], 24) & 0xff00ff00 | a(ai[i], 8) & 0xff00ff;
	}

	private final int b(int i) {
		int ai[] = d;
		return (ai)[i & 0xf] = a(ai[i + 13 & 0xf] ^ ai[i + 8 & 0xf]
				^ ai[i + 2 & 0xf] ^ ai[i & 0xf], 1);
	}

	private void b() {
		int ai[];
		(ai = new int[5])[0] = a[0];
		ai[1] = a[1];
		ai[2] = a[2];
		ai[3] = a[3];
		ai[4] = a[4];
		int i = 1;
		int j = 2;
		int k = 3;
		int l = 4;
		int i1 = 0;
		int j1 = 0;
		for (int k1 = 0; k1 < 80; k1++) {
			int l1 = i1;
			i1 = l;
			l = k;
			k = j;
			j = i;
			i = l1;
			switch (j1) {
			default:
				break;

			case 0: // '\0'
				ai[i1] += (ai[j] & (ai[k] ^ ai[l]) ^ ai[l]) + a(k1)
						+ 0x5a827999 + a(ai[i], 5);
				ai[j] = a(ai[j], 30);
				if (k1 == 15)
					j1++;
				break;

			case 1: // '\001'
				ai[i1] += (ai[j] & (ai[k] ^ ai[l]) ^ ai[l]) + b(k1)
						+ 0x5a827999 + a(ai[i], 5);
				ai[j] = a(ai[j], 30);
				if (k1 == 19)
					j1++;
				break;

			case 2: // '\002'
				ai[i1] += (ai[j] ^ ai[k] ^ ai[l]) + b(k1) + 0x6ed9eba1
						+ a(ai[i], 5);
				ai[j] = a(ai[j], 30);
				if (k1 == 39)
					j1++;
				break;

			case 3: // '\003'
				ai[i1] += ((ai[j] | ai[k]) & ai[l] | ai[j] & ai[k]) + b(k1)
						+ 0x8f1bbcdc + a(ai[i], 5);
				ai[j] = a(ai[j], 30);
				if (k1 == 59)
					j1++;
				break;

			case 4: // '\004'
				ai[i1] += (ai[j] ^ ai[k] ^ ai[l]) + b(k1) + 0xca62c1d6
						+ a(ai[i], 5);
				ai[j] = a(ai[j], 30);
				break;
			}
		}

		a[0] += ai[0];
		a[1] += ai[1];
		a[2] += ai[2];
		a[3] += ai[3];
		a[4] += ai[4];
	}

	private void a(byte byte0) {
		int i = (e & 3) << 3;
		b += 8L;
		d[e >> 2] &= ~(255 << i);
		d[e >> 2] |= (byte0 & 0xff) << i;
		e++;
		if (e == 64) {
			b();
			e = 0;
		}
	}

	public final void a(byte abyte0[]) {
		a(abyte0, 0, abyte0.length);
	}

	private void a(byte abyte0[], int i, int j) {
		for (int k = i + j; i < k; i++)
			a(abyte0[i]);

	}

	public final void b(byte abyte0[]) {
		a(abyte0, 0, abyte0.length);
		c();
	}

	private void c() {
		byte abyte0[];
		abyte0 = new byte[8];
		for (int i = 0; i < 8; i++)
			abyte0[i] = (byte) (int) (b >>> (7 - i << 3) & 255L);

		a(-128);
		while (e != 56) {
			a(0);
		}

		for (int j = 0; j < abyte0.length; j++)
			a(abyte0[j]);

		for (int k = 0; k < 20; k++)
			c[k] = (byte) (a[k >> 2] >> (3 - (k & 3) << 3) & 0xff);
	}

	public final byte[] a() {
		byte abyte0[] = new byte[20];
		System.arraycopy(c, 0, abyte0, 0, 20);
		return abyte0;
	}

	public final String toString() {
		return bb.a(c);
	}
}